Tidy the error-type map and WebSocket close-reason limit#209
Merged
ndisidore merged 2 commits intoJul 9, 2026
Conversation
|
commit: |
dimitropoulos
approved these changes
Jul 9, 2026
dimitropoulos
left a comment
Collaborator
There was a problem hiding this comment.
some small improvements suggested, but not super blocking
- serialize.ts: use a null-prototype object literal for ERROR_TYPES instead of Object.assign(Object.create(null), ...). - websocket.ts: derive the close-reason cap from the RFC 6455 Close-frame size (125 - 2) rather than a bare 123, and shorten the comment. - test: split a multi-byte character exactly at the limit so the streaming truncation path is actually exercised (the previous input landed on a character boundary). No behavior change.
The guard in ImportTableEntry.resolve() defended a state the protocol can't reach: after a normal resolve the import entry is deleted (sendRelease -> delete this.imports[id]), so a duplicate "resolve" message lands on the "import not found" path and never calls resolve() a second time. Its test also passed with the guard removed. Remove both, and drop the changeset since this is a cleanup with no behavior change.
4ced72a to
d3fc75d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No behavior change.